/**********************************************************************
 * Filename: CalendarDate.java
 * Created: 2012/04/30
 * @author Fernando Brito e Abreu
 **********************************************************************/
package org.quasar.CopaPaises.businessLayer;

import java.util.Set;
import java.util.HashSet;

public class CalendarDate {
	public static Set<CalendarDate> allInstances = new HashSet<CalendarDate>();

	private int day;
	private int month;
	private int year;

	/**********************************************************************
	 * Default constructor
	 **********************************************************************/
	public CalendarDate() {
		allInstances.add(this);
	}

	/**********************************************************************
	 * Parameterized constructor
	 * 
	 * @param day
	 *            the day to initialize
	 * @param month
	 *            the month to initialize
	 * @param year
	 *            the year to initialize
	 **********************************************************************/
	public CalendarDate(int day, int month, int year) {
		this.day = day;
		this.month = month;
		this.year = year;
		allInstances.add(this);
	}

	/**********************************************************************
	 * Standard attribute getter
	 * 
	 * @return the day of the calendarDate
	 **********************************************************************/
	public int day() {
		return day;
	}

	/**********************************************************************
	 * Standard attribute setter
	 * 
	 * @param day
	 *            the day to set
	 **********************************************************************/
	public void setDay(int day) {
		this.day = day;
	}

	/**********************************************************************
	 * Standard attribute getter
	 * 
	 * @return the month of the calendarDate
	 **********************************************************************/
	public int month() {
		return month;
	}

	/**********************************************************************
	 * Standard attribute setter
	 * 
	 * @param month
	 *            the month to set
	 **********************************************************************/
	public void setMonth(int month) {
		this.month = month;
	}

	/**********************************************************************
	 * Standard attribute getter
	 * 
	 * @return the year of the calendarDate
	 **********************************************************************/
	public int year() {
		return year;
	}

	/**********************************************************************
	 * Standard attribute setter
	 * 
	 * @param year
	 *            the year to set
	 **********************************************************************/
	public void setYear(int year) {
		this.year = year;
	}

	/**********************************************************************
	 * User-defined operation specified in SOIL/OCL
	 * 
	 * @param day
	 *            the day to set
	 * @param month
	 *            the month to set
	 * @param year
	 *            the year to set
	 **********************************************************************/
	public void init(int day, int month, int year) {

	}

	/**********************************************************************
	 * User-defined operation specified in SOIL/OCL
	 * 
	 * @param date
	 *            the date to set
	 **********************************************************************/
	public void initS(String date) {

	}

	/**********************************************************************
	 * User-defined operation specified in SOIL/OCL
	 * 
	 * @param t
	 *            the t to set
	 **********************************************************************/
	public boolean isAfter(CalendarDate t) {

		return true;
	}

	/**********************************************************************
	 * User-defined operation specified in SOIL/OCL
	 * 
	 * @param t
	 *            the t to set
	 **********************************************************************/
	public boolean isBefore(CalendarDate t) {

		return true;
	}

	/**********************************************************************
	 * User-defined operation specified in SOIL/OCL
	 * 
	 * @param x
	 *            the x to set
	 * @param y
	 *            the y to set
	 **********************************************************************/
	public boolean isDivisible(int x, int y) {

		return true;
	}

	/**********************************************************************
	 * User-defined operation specified in SOIL/OCL
	 * 
	 * @param t
	 *            the t to set
	 **********************************************************************/
	public boolean isEqual(CalendarDate t) {

		return true;
	}

	/**********************************************************************
	 * User-defined operation specified in SOIL/OCL
	 **********************************************************************/
	public boolean isLeap() {

		return true;
	}

	/**********************************************************************
	 * User-defined operation specified in SOIL/OCL
	 * 
	 * @param date
	 *            the date to set
	 **********************************************************************/
	public CalendarDate stringToDate(String date) {

		return null;
	}

	/**********************************************************************
	 * User-defined operation specified in SOIL/OCL
	 * 
	 * @param t
	 *            the t to set
	 **********************************************************************/
	public int yearsSince(CalendarDate t) {

		return -1;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	/**********************************************************************
	 * Object serializer
	 **********************************************************************/
	public String toString() {
		return "CalendarDate [day=" + day + ", month=" + month + ", year="
				+ year + "]\n";
	}

}
